<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>关注的房源</title>
    <style>
        body {
            font-family: Arial, sans-serif;
            background-color: #f5f5f5;
            margin: 0;
            padding: 0;
            color: #333;
        }
        .container {
            display: flex;
            flex-direction: row;
            margin: 0 auto;
            width: 80%;
            background-color: #fff;
            box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
            border-radius: 5px;
        }
        .sidebar {
            width: 200px;
            background-color: #f9f9f9;
            border-right: 1px solid #ddd;
            padding: 15px;
        }
        .sidebar img {
            width: 100%;
            border-radius: 50%;
        }
        .sidebar ul {
            list-style-type: none;
            padding: 0;
        }
        .sidebar ul li {
            margin: 10px 0;
        }
        .sidebar ul li a {
            text-decoration: none;
            color: #333;
            padding: 8px 15px;
            display: block;
            border-radius: 4px;
        }
        .sidebar ul li a:hover {
            background-color: #e0e0e0;
        }
        .sidebar ul li a.active {
            background-color: #1e90ff;
            color: #fff;
        }
        .content {
            flex: 1;
            padding: 20px;
        }
        .content h1 {
            font-size: 24px;
            margin: 0;
        }
        .tabs {
            display: flex;
            border-bottom: 1px solid #ddd;
            margin-top: 20px;
        }
        .tabs button {
            background: none;
            border: none;
            padding: 10px 20px;
            cursor: pointer;
            font-size: 16px;
            color: #333;
            border-bottom: 3px solid transparent;
        }
        .tabs button.active {
            border-bottom: 3px solid #1e90ff;
            color: #1e90ff;
        }
        .tab-content {
            display: none;
            padding: 20px;
        }
        .tab-content.active {
            display: block;
        }
        .empty-state {
            text-align: center;
            margin-top: 50px;
            color: #777;
        }
        .empty-state img {
            width: 100px;
            opacity: 0.5;
        }
    </style>
</head>
<body>
<div class="container">
    <div class="sidebar">
        <img src="https://via.placeholder.com/100" alt="用户头像">
        <p>欢迎你, 13****34</p>
        <ul>
            <li><a href="#" class="sidebar-link active" onclick="activateSidebar(event)">关注的房源</a></li>
            <li><a href="#" class="sidebar-link" onclick="activateSidebar(event)">关注的小区</a></li>
            <li><a href="#" class="sidebar-link" onclick="activateSidebar(event)">我的经纪人</a></li>
            <li><a href="#" class="sidebar-link" onclick="activateSidebar(event)">看房记录</a></li>
            <li><a href="#" class="sidebar-link" onclick="activateSidebar(event)">我的委托</a></li>
            <li><a href="#" class="sidebar-link" onclick="activateSidebar(event)">我的搜索</a></li>
            <li><a href="#" class="sidebar-link" onclick="activateSidebar(event)">编辑资料</a></li>
        </ul>
    </div>
    <div class="content">
        <h1>共 <span id="count">0</span> 套 关注房源</h1>
        <div class="tabs">
            <button class="tablink active" onclick="openTab(event, 'secondHand')">二手房</button>
            <button class="tablink" onclick="openTab(event, 'newHouse')">新房</button>
            <button class="tablink" onclick="openTab(event, 'rental')">租房</button>
        </div>
        <div id="secondHand" class="tab-content active">
            <div class="empty-state">
                <img src="https://via.placeholder.com/100" alt="empty">
                <p>还没有关注任何房源哦</p>
            </div>
        </div>
        <div id="newHouse" class="tab-content">
            <div class="empty-state">
                <img src="https://via.placeholder.com/100" alt="empty">
                <p>还没有关注任何房源哦</p>
            </div>
        </div>
        <div id="rental" class="tab-content">
            <div class="empty-state">
                <img src="https://via.placeholder.com/100" alt="empty">
                <p>还没有关注任何房源哦</p>
            </div>
        </div>
    </div>
</div>

<script>
    function openTab(evt, tabName) {
        var i, tabcontent, tablinks;
        tabcontent = document.getElementsByClassName("tab-content");
        for (i = 0; i < tabcontent.length; i++) {
            tabcontent[i].style.display = "none";
            tabcontent[i].classList.remove("active");
        }
        tablinks = document.getElementsByClassName("tablink");
        for (i = 0; i < tablinks.length; i++) {
            tablinks[i].classList.remove("active");
        }
        document.getElementById(tabName).style.display = "block";
        document.getElementById(tabName).classList.add("active");
        evt.currentTarget.classList.add("active");
    }

    function activateSidebar(evt) {
        var i, sidebarlinks;
        sidebarlinks = document.getElementsByClassName("sidebar-link");
        for (i = 0; i < sidebarlinks.length; i++) {
            sidebarlinks[i].classList.remove("active");
        }
        evt.currentTarget.classList.add("active");
    }
</script>
</body>
</html>
